#docker rmi -f gitlab/gitlab-ee:latest
docker pull gitlab/gitlab-ee:latest
rm -rf /cardone/docker/images/gitlab/gitlab-ee_latest.tar
mkdir -p /cardone/docker/images/gitlab
docker save gitlab/gitlab-ee:latest > /cardone/docker/images/gitlab/gitlab-ee_latest.tar
#docker load < /cardone/docker/images/gitlab/gitlab-ee_latest.tar



#docker rmi -f gitlab/gitlab-runner:alpine
docker pull gitlab/gitlab-runner:alpine
rm -rf /cardone/docker/images/gitlab/gitlab-runner.alpine.tar
mkdir -p /cardone/docker/images/gitlab
docker save gitlab/gitlab-runner:alpine > /cardone/docker/images/gitlab/gitlab-runner.alpine.tar
#docker load < /cardone/docker/images/gitlab/gitlab-runner.alpine.tar



docker node update --label-add cardone-gitlab_gitlab=true cardone-01-09
# docker node update --label-add cardone-gitlab_gitlab-runner=true cardone-01-09

docker stack rm cardone-gitlab

docker stack deploy -c /cardone/middlewares/gitlab/prod.yml cardone-gitlab

for i in {1..10}  
do  
sleep $i

docker stack ps cardone-gitlab

docker service ls
done

docker service logs cardone-gitlab_gitlab -f --tail 300

docker service logs cardone-gitlab_gitlab-runner -f --tail 300

## 修改用户密码 luoc

docker exec -it 1a7ac278b9fd bash

gitlab-rails console

user = User.where(username: 'luoc').first

user.password = 'luoc@123456'

user.save!


## 修改用户密码 yaohaitao

docker exec -it 9da83fdeac98 bash

gitlab-rails console

user = User.where(username: 'yaohaitao').first

user.password = 'fand.yht123'

user.save!


## 注册 runner

docker exec -t e5abcfa9e623 bash

gitlab-runner register
